package com.hmall.api;

import com.hmall.common.utils.UserContext;
import feign.RequestInterceptor;
import feign.RequestTemplate;

public class FeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        Long userId= UserContext.getUser();
        if (userId!=null){
            template.header("user-info", userId.toString());
        }
    }
}
